package day8;

import java.io.IOException;
import java.io.RandomAccessFile;

public class FileDemo10 {

    public static void main(String[] args) {
        try(RandomAccessFile raf = new RandomAccessFile("E:\\vue\\yq_JAVA\\src\\main\\resources\\ac.txt", "rw")){
            while (raf.read() > 0){
                System.out.println(raf.read());
            }
            System.out.println(raf.getFilePointer());
            raf.seek(raf.getFilePointer() - 1);
            for (int i = 0; i < 10; i++){
                raf.writeInt(i);
                System.out.println(raf.getFilePointer());
            }
        } catch (IOException e){
          e.printStackTrace();
        }

    }
}
